// @ts-ignore
// @ts-nocheck

export function hook_activity() {
  var Activity = Java.use("android.app.Activity");
  //console.log(Object.getOwnPropertyNames(Activity));
  Activity.startActivity.overload('android.content.Intent').implementation=function(intent){
      console.log("Hooking android.app.Activity.startActivity(intent) successfully,intent="+intent);
      console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
      console.log(decodeURIComponent(intent.toUri(0)));
      this.startActivity(intent);
  }
  Activity.startActivity.overload('android.content.Intent', 'android.os.Bundle').implementation=function(intent,p2){
      console.log("Hooking android.app.Activity.startActivity(intent,p2) successfully,intent="+intent+",p2="+p2);
      console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
      console.log(decodeURIComponent(intent.toUri(0)));
      this.startActivity(intent,p2);
  }
  Activity.startService.overload('android.content.Intent').implementation=function(intent){
      console.log("Hooking android.app.Activity.startService(intent) successfully,intent="+intent);
      console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
      console.log(decodeURIComponent(intent.toUri(0)));
      this.startService(intent);
  }
}

// export {
//   hook_activity
// }